<?php
include '../tools/SignAndCheck.php';
$res = $_POST['res'];
$data = base64_decode($res);
$obj = json_decode($data, TRUE);
$signature = $obj['sign'];
$obj['sign'] = '';
$obj['sign_type'] = '';

$strData = getStr($obj);
if(verify($strData, $signature, '../cer/dev_pub.pem')){
    echo "验证成功";
    echo '<br>';
    if($obj['status'] == '1'){
        echo "签约成功<br>";
        echo $data;
    }else {
        echo "签约失败";
    }
}else{
    echo "验证失败";
}


?>